﻿using System;
using System.Runtime.InteropServices;

namespace Microsoft.Win32
{
	internal static partial class NativeMethods
	{
		public const uint CLR_NONE = 0xFFFFFFFF;
		public const uint CLR_DEFAULT = 0xFF000000;

		[Flags]
		public enum ImageListDrawingStyle : uint
		{
			Normal = 0x00000000,
			Transparent = 0x00000001,
			Blend25 = 0x00000002,
			Blend50 = 0x00000004,
			Mask = 0x00000010,
			Image = 0x00000020,
			Rop = 0x00000040,
			OverlayMask = 0x00000F00,
			PreserveAlpha = 0x00001000, // This preserves the alpha channel in dest
			Scale = 0x00002000, // Causes the image to be scaled to cx, cy instead of clipped
			DpiScale = 0x00004000,
			Async = 0x00008000,
		}

		[DllImport("comctl32.dll", SetLastError = true)]
		[return: MarshalAs(UnmanagedType.Bool)]
		public extern static bool ImageList_SetOverlayImage(IntPtr himl, int iImage, int iOverlay);

		[DllImport("comctl32.dll", SetLastError = true)]
		[return: MarshalAs(UnmanagedType.Bool)]
		public extern static bool ImageList_DrawEx(IntPtr himl, int i, IntPtr hdcDst, int x, int y, int dx, int dy, uint rgbBk, uint rgbFg, ImageListDrawingStyle fStyle);
	}
}